#include<bits/stdc++.h>
using namespace std;
int main(){
    int x;
    cin >> x;
    for(int i = 10; i <= 99; i++){
        int a = i%10;
        int b = i/10%10;
        int c = x-2*(a+b);
        if (c >= 0&&c <= 9){
            cout << b << a << c << a << b <<endl;
        }
    }
    if(!(x%2)){
        for(int i = 100; i <= 999; i++){
        int a = i%10;
        int b = i/10%10;
        int c = i/100%10;
        if(2*(a+b+c) == x){
            cout << c << b << a << a << b << c <<endl;
            }
        }
    }
    return 0;
}